import type { BrowserWindow } from 'electron'
import { Controller, Inject, IpcHandle,  IpcOn, Window, BaseController  } from '@support/index'
import { XiaomiService } from './xm.service'

@Controller()
export class XiaomiController extends BaseController {
  constructor(
    private systemService: XiaomiService,
    @Inject('IS_DEV') 
    private isDev: boolean,
    @Window() 
    private win: BrowserWindow,
  ) { super() }

  @IpcOn('system-message1')
  public async testMessage( msg: string): Promise<string>{
    console.log('in system-message', msg)
    return this.systemService.testMessage()
  }

  @IpcOn('messag-test')
  public async handleSendMsg(msg: string): Promise<string> {
    console.log('messag-test')
    return this.systemService.reply()
  }
}